package com.lighting.lightingservice.service;

import com.lighting.lightingservice.dto.Image;
import com.lighting.lightingservice.dto.Video;
import com.lighting.lightingservice.mapper.ImageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ImageService {

    @Autowired
    ImageMapper imageMapper;

    public List<Image> getImageByDB(){
        List<Image> all = imageMapper.findAll();

        for (Image image : all) {
            System.out.println(image.getName());
            return all;
        }
        return null;
    }

    public void insertImage(String name, String url){
        imageMapper.insertImage(name, url);
    }

    public void deleteImage(String name){
        imageMapper.deleteImage(name);
    }
}
